import 'package:cream_chat_flutter/pages/MyDetails/MydetailsProvider.dart';
import 'package:cream_chat_flutter/globals/ThemeProvider.dart';
import 'package:provider/provider.dart';
import 'package:flutter/material.dart';

///路由页 我的详情页，需要继承Page
class MyDetails extends Page {
  const MyDetails({
    LocalKey key,
    String name,
  }) : super(key: key, name: name);

  Route createRoute(BuildContext context) => MaterialPageRoute(
        settings: this,
        builder: (BuildContext context) => ChangeNotifierProvider(
            create: (context) => MyDetailsProvider(), child: _MyDetails()),
      );
}

class _MyDetails extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => _MyDetailsState();
}

class _MyDetailsState extends State<_MyDetails> {
  @override
  Widget build(BuildContext context) {
    return Consumer2(
        builder: (BuildContext context, ThemeProvider tp, MyDetailsProvider mp,
                Widget child) =>
            Scaffold(
              appBar: AppBar(title: tp.Title("我的资料")),
              body: Text("我的资料"),
            ));
  }
}
